import Rules from './Rules';

const { COMMON_RULE, LENGTH_RULE } = Rules;

export const mallRule = {
  templateCode: COMMON_RULE().concat(LENGTH_RULE(1, 100)),
  title: COMMON_RULE().concat(LENGTH_RULE(1, 127)),
  uid: COMMON_RULE(),
  categoryId: COMMON_RULE({ type: 'number' }),
  kind: COMMON_RULE({ type: 'number' }),
  returnable: COMMON_RULE({ type: 'number' }),
  bannerTemplate: COMMON_RULE({ type: 'number' }),
  eticket: COMMON_RULE({ type: 'number' }),
  showIntro: COMMON_RULE({ type: 'number' }),
  deliverUnit: COMMON_RULE(),
  longitude: COMMON_RULE(),
  latitude: COMMON_RULE(),
  imageList: [
    {
      type: 'array',
      required: true,
      message: '该项为必填项',
      trigger: 'change',
    },
  ],
  detail: COMMON_RULE(),
  pcDetail: COMMON_RULE(),
  instruction: COMMON_RULE(),
  pcInstruction: COMMON_RULE(),
};
